<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
  <title>infer name test</title>
  <script src="../../../webcomponentsjs/webcomponents.js"></script>
  <link rel="import" href="import-infer-name.html">
  <script src="../../../tools/test/htmltest.js"></script>
  <script src="../../../tools/test/chai/chai.js"></script>
</head>
<body>

  <polymer-element name="infer-name-main-doc">
    <template>
      {{message}}
    </template>
    <script>
      Polymer({
        ready: function() {
          this.isReady = true;
        },
        message: 'Hi'
      });
    </script>
  </polymer-element>

  <polymer-element name="infer-name-remote-script">
    <template>
      {{message}}
    </template>
    <script src="infer-name-script.js"></script>
  </polymer-element>

  <infer-name-main-doc></infer-name-main-doc>

  <infer-name></infer-name>

  <infer-name-remote-script></infer-name-remote-script>
  
  <infer-name-remote-script-import></infer-name-remote-script-import>
  
  <script>
    document.addEventListener('polymer-ready', function() {
      var x = document.querySelector('infer-name-main-doc');
      chai.assert.ok(x.isReady);
      //
      var y = document.querySelector('infer-name');
      chai.assert.ok(y.isReady);
      //
      var z = document.querySelector('infer-name-remote-script');
      chai.assert.ok(z.isReady);
      //
      var z1 = document.querySelector('infer-name-remote-script-import');
      chai.assert.ok(z1.isReady);
      done();
    });
  </script>
</body>
</html>
